<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Vue实例练习NOTE</title>
</head>
<body>
    <div id="app">
        my name is {{Student.StuName}}
        <h1>
            my name is {{Student.StuName + "&nbsp;"+Student.age}}
        </h1>

        {{!flag?msg:flag}}
        <button v-on:dblclick="ageChange">双击增加年龄</button>
        

    </div>

    <script src="vue.js"></script>
    <script>
        const newVue = new Vue({
            el:"#app",
            data: function() {
                return {
                    msg:"Hello",
                    Student:{
                        StuName:"Sam",
                        age:22
                    },
                    flag:"true"
                }
            },
            methods: {
                ageChange:function(){
                    this.Student.age="23"
                }
            }
        })
        
    </script>
</body>
</html> 

